package xinyu.customer.widget.dialog;


import androidx.fragment.app.DialogFragment;

import xinyu.customer.R;

public class BaseDialogFragment extends DialogFragment {
    private CustomProgressDialog mLoading;

    /**
     * showLoading
     */
    public void showLoadingDialog() {
        if (getActivity().isFinishing()) {
            return;
        }
        if (null == mLoading) {
            mLoading = new CustomProgressDialog(getContext(), getString(R.string.loading_msg), true, true);
        }
    }

    /**
     * hideLoading
     */
    public void hideLoadingDialog() {
        if (getActivity().isFinishing()) {
            return;
        }
        if (mLoading != null && mLoading.isShowing()) {
            mLoading.dismiss();
            mLoading = null;
        }
    }

}
